home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / DiskMaster / Rexx / DMSelectByCmt.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2002-10-27  |  1.0 KB  |  38 lines

  1. /* $VER:  DMSelectByCmt.rexx 1.1 (2.10.98) by J. Tierney
  2.  
  3.   DiskMaster II Select By Comment  v1.1
  4.   10/2/98  J. Tierney <jtierney@cyberlink-inc.com>
  5.  
  6.   Purpose:  Select files based on their comments.
  7.  
  8.   Usage:  REXX DMSelectByCmt.rexx [CASE]
  9.  
  10.           CASE - If specified, the matching is case-sensitive:  "a" <> "A".
  11.                  The default is to be case-insensitive:  "a" = "A".
  12.  
  13.   Note:  To match whole words put a space on either side of the word.
  14.         "not" will match "not", "note", "nothing", "knot", etc.
  15.         " not " will only match " not ".
  16.  
  17.   Ex:  REXX DMSelectByCmt.rexx        - Case-insensitive matching.
  18.        REXX DMSelectByCmt.rexx CASE   - Case-sensitive matching.
  19. */
  20.  
  21. OPTIONS RESULTS
  22.  
  23. ARG ncs .
  24. IF ncs = 'CASE' THEN ncs = 0
  25. ELSE ncs = 1
  26.  
  27. 'CONFIRM "Text to Match:" Okay Cancel " "'
  28. cmt = result
  29. IF ncs THEN cmt = UPPER(cmt)
  30.  
  31. DIRLIST VAR dlist COMMENT
  32.  
  33. DO i = 1 TO dlist.name.0
  34.   IF ncs THEN dlist.comment.i = UPPER(dlist.comment.i)
  35.   IF POS(cmt, dlist.comment.i) > 0 THEN 'SELECT' dlist.name.i
  36. END
  37.  
  38.